#!/usr/bin/python
# -*- coding: UTF-8 -*-
#author:MinkieDash
#需要Linux安装xsel和xdotool两个程序
import tkinter
import time
import os
from subprocess import Popen,PIPE

top = tkinter.Tk()
top.geometry("300x100")
top.title("Linux游戏中文聊天工具")
chinese_input = tkinter.Entry(top)
def enterback():
    input_text = chinese_input.get().encode('utf-8')
    top.iconify()
    cp = Popen(['xsel', '-bi'], stdin=PIPE)
    cp.communicate(input=input_text)
    os.system('xdotool key --delay 150 ctrl+v')
enter = tkinter.Button(top,text="确认",command = enterback)
chinese_input.pack(expand=True,fill='x')
enter.pack()
top.mainloop()
